﻿@model dziennik_asp_mvc.ViewModels.SubjectsViewModel

@{
    ViewBag.Title = ViewBag.Type;
}

<div class="panel panel-primary">
    <div class="panel-heading">@(ViewBag.Type == "edit" ? "Edycja" : "Tworzenie nowego")  przedmiotu</div>
    <div class="panel-body">
        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()
            <div class="form-horizontal">
                @Html.ValidationSummary(true)

                <div class="form-group">
                    @Html.LabelFor(model => model.subject.subject_name, new { @class = "col-lg-2 control-label" })
                    <div class="col-lg-3">
                        @Html.TextBoxFor(model => model.subject.subject_name, new { @class = "form-control", @placeholder = "Nazwa przedmiotu..." })
                        @Html.ValidationMessageFor(model => model.subject.subject_name)
                    </div>
                </div>


                <div class="form-group">
                   @Html.Label("Grupa", new { @class = "col-lg-2 control-label" })
                    <div class="col-lg-3">
                        @Html.ListBoxFor(model => model.SelectedGroups, (IEnumerable<SelectListItem>)ViewBag.Groups, new { @class = "chzn-select btn-block" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.Label("Wykładowca", new { @class = "col-lg-2 control-label" })
                    <div class="col-lg-3">
                        @Html.DropDownListFor(model => model.SelectedUser, (IEnumerable<SelectListItem>)ViewBag.Teachers, new { @class = "chzn-select btn-block" })
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-2">
                        <input type="submit" value="Dodaj przedmiot" class="btn btn-primary btn-block" />
                    </div>
                </div>
            </div>
        }

    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}